<template>
    <div class="concatUs">
        <div class="topBox">
            <img class="leftImg" src="../../static/imgs/left_b.png" @click="handleBack" alt="">
            <div class="title">
                {{ $t('assemble.用户手册') }}
            </div>
        </div>

        <div class="listBox">

            <div class="tableData" v-for="(item, index) in tableData">
                <div class="leftBox">
                    <img class="imgIcon" :src="item.imgsrc" alt="" srcset="">
                    <div class="name">{{ item.filename }}</div>
                </div>
                <div class="down" @click="loadFile(item.url)">
                    {{ $t('assemble.下载手册') }}
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { getuserhandbook } from "../../utils/api"
export default {
    components: {

    },
    data() {
        return {
            content: "",
            lang: 'zh',
            tableData: [],

        }
    },
    created() {
        this.$i18n.locale = localStorage.getItem('langtype')
        this.lang = localStorage.getItem('langtype')

    },
    mounted() {
        this.getuserhandbook()
    },
    methods: {
        async getuserhandbook() {
            let res = await getuserhandbook()
            if (res.code == 1) {
                console.log("用户手册", res)
                this.tableData = res.data
                this.tableData.forEach((item, index) => {
                    item.imgsrc = `https://demo163.1p5.net/jVQdZLgDMK.php/ajax/icon?suffix=${item.imagetype}`
                })
            }
            // if (res.code == 401) {
            //     this.$router.push({ path: '/login' })
            // }
        },

        //下载手册
        loadFile(url) {
            console.log("文件路径", url)
            window.open(url)
        },
        handleBack() {
            this.$router.back(1)
        },
    },
}
</script>

<style scoped lang="scss">
@media screen and (max-width: 750px) {
    .topBox {
        width: 100%;
        height: 44px;
        // padding: 10px 15px;
        padding-top: 10px;
        position: relative;
        font-family: PingFang SC, PingFang SC;
        font-weight: 600;
        font-size: 16px;
        color: #333333;
        line-height: 19px;
        text-align: left;
        font-style: normal;
        text-transform: none;

        .leftImg {
            width: 24px;
            height: 24px;
            position: absolute;
            top: 10px;
            left: 15px;
        }

        .title {
            width: 100%;
            text-align: center;

        }
    }



    .listBox {
        width: 100%;
        padding: 20px;
        box-sizing: border-box;


        .tableData {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .leftBox {
                display: flex;
                align-items: center;

                .imgIcon {
                    width: 36px;
                    height: 36px;
                }

                .name {
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 16px;
                    color: #333333;
                    line-height: 27px;
                    text-align: justified;
                    font-style: normal;
                    text-transform: none;
                    margin-left: 10px;
                }
            }

            .down {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 16px;
                color: #E00000;
                line-height: 27px;
                text-align: justified;
                font-style: normal;
                text-transform: none;
            }
        }
    }
}

@media screen and (min-width: 751px) and (max-width: 1300px) {

    .topBox {
        width: 100%;
        height: 88px;
        // padding: 10px 15px;
        padding-top: 20px;
        position: relative;
        font-family: PingFang SC, PingFang SC;
        font-weight: 600;
        font-size: 25px;
        color: #333333;
        line-height: 19px;
        text-align: left;
        font-style: normal;
        text-transform: none;
        display: flex;
        align-items: center;

        .leftImg {
            width: 48px;
            height: 48px;
            position: absolute;
            top: 40px;
            left: 30px;
        }

        .title {
            width: 100%;
            text-align: center;

        }
    }

     .listBox {
        width: 100%;
        padding: 60px;
        box-sizing: border-box;


        .tableData {
            display: flex;
            align-items: center;
            justify-content: space-between;

            .leftBox {
                display: flex;
                align-items: center;

                .imgIcon {
                    width: 72px;
                    height: 72px;
                }

                .name {
                    font-family: PingFang SC, PingFang SC;
                    font-weight: 400;
                    font-size: 24px;
                    color: #333333;
                    line-height: 27px;
                    text-align: justified;
                    font-style: normal;
                    text-transform: none;
                    margin-left: 10px;
                }
            }

            .down {
                font-family: PingFang SC, PingFang SC;
                font-weight: 400;
                font-size: 24px;
                color: #E00000;
                line-height: 27px;
                text-align: justified;
                font-style: normal;
                text-transform: none;
            }
        }
    }
}
</style>